package cn.anc.aonicardv.util;

import android.content.Context;

import com.hjq.permissions.Permission;
import com.hjq.permissions.XXPermissions;


/**
 * Created by yangdai on 2017/12/21.
 */

public class AppPermissionsUtils {

    public static boolean checkExternalStorage(Context context) {
        return XXPermissions.isGrantedPermission(context, new String[]{
                Permission.WRITE_EXTERNAL_STORAGE,
                Permission.READ_EXTERNAL_STORAGE});
    }

    public static boolean checkLocation(Context context) {
        return XXPermissions.isGrantedPermission(context, new String[]{
                Permission.ACCESS_FINE_LOCATION,
                Permission.ACCESS_COARSE_LOCATION});
    }

    public static boolean checkAllLocation(Context context) {
        return XXPermissions.isGrantedPermission(context, new String[]{
                Permission.ACCESS_FINE_LOCATION,
                Permission.ACCESS_COARSE_LOCATION,
                Permission.WRITE_EXTERNAL_STORAGE,
                Permission.READ_EXTERNAL_STORAGE});
    }


}
